package com.cyblogs.spring.demo;

import com.cyblogs.spring.demo.config.SpringConfigDemo;
import com.cyblogs.spring.demo.service.UserAService;
import com.cyblogs.spring.demo.service.UserBService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created with spring-famliy-learn
 *
 * @Description:
 * @Author: chenyuan
 * @Date: 2021/2/20
 * @Time: 11:45
 */
public class SpringDemoApplication {

	public static void main(String[] args) throws InterruptedException {
		ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfigDemo.class);
		UserAService userAService = context.getBean(UserAService.class);
		userAService.sayHello();

		UserBService userBService = context.getBean(UserBService.class);
		userBService.sayHello();

		while (true) {
			Thread.sleep(10000);
		}
	}

}
